#	m42-xmas-memory
#   Copyright (C) 2014  Jannik Haberbosch
#
#	This program is free software: you can redistribute it and/or modify
#	it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.


import pygame
pygame.init()


from code.classes.Text import Text
from code.constants import fonts


class Player( object ):
	"""

	"""
	def __init__( self, _id, _name ):
		self.id = _id
		self.name = _name
		self.tries = 0
		self.pairs = 0

		self.texts = pygame.sprite.Group()

		self.update_hud()


	def update_tries( self ):

		self.tries += 1


	def update_pairs( self ):

		self.pairs += 1

		
	def update_hud( self ):

		self.texts.empty()

		self.texts.add(
			Text(
				fonts.FONT_TEXT_BOLD,
				"%s, it's your turn!" % self.name,
				( 900, 100 )
			)
		)
		self.texts.add(
			Text(
				fonts.FONT_TEXT_BOLD,
				"Tries: %d" % self.tries,
				( 900, 150 )
			)
		)
		self.texts.add(
			Text(
				fonts.FONT_TEXT_BOLD,
				"Pairs: %d" % self.pairs,
				( 900, 200 )
			)
		)
